<?php

/**
 * Study actions.
 *
 * @package    5
 * @subpackage Study
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class StudyActions extends sfActions
{
  public function executeShow(sfWebRequest $request)
  {
    $roles = array(
      'index',
      '01',
      '02',
      '03',
      '04',
      '05'
    );
    $role = $request->getParameter('role');
    $this->forward404Unless(in_array($role, $roles));
    $this->setTemplate($role);
    
    $articleTable = Doctrine_Core::getTable('Article');
    $this->articles1 = $articleTable->findByCategoryName('官方动态');
    $this->articles2 = $articleTable->findByCategoryName('五行管理');
    $this->articles3 = $articleTable->findByCategoryName('五行养生');
    $this->articles4 = $articleTable->findByCategoryName('课程中心');
    $this->articles5 = $articleTable->findByCategoryName('专家介绍');
    $this->articles6 = $articleTable->findByCategoryName('五行视频');
  }
}